GXCopyToColorSet
You can use theGXCopyToColorSet
function to copy the contents of one existing color set to another, or to create a new color set and copy the contents of an existing color set into it.
gxColorSet GXCopyToColorSet(gxColorSet target, gxColorSet source);
target
- A reference to the color set to copy the source color set's contents into. If you specify
nil
for this parameter, the function creates a new color set.source
- A reference to the color set whose contents you want to copy.
- function result
- A reference to the color set copy.
DESCRIPTION
The GXCopyToColorSet function copies the contents of an existing color set object to another or it creates a new color set object and copies the contents of an existing color set object to it. The function copies the color space and color values and tag list (but not the owner count) of the color set object specified by thesource
parameter into the color set object specified by thetarget
parameter. It clones, but does not copy, the tag objects in the tag list.If you specify
nil
for thetarget
parameter,GXCopyToColorSet
creates a new color set object and copies the source color set's properties, including the owner count and tag list, into it.You can use the GXCopyToColorSet function to create a copy of a color set and then modify it without changing the original.
SPECIAL CONSIDERATIONS
If you specifynil
for thetarget
parameter and no error occurs, theGXCopyToColorSet
function creates a color set object; you are responsible for disposing of that object when you no longer need it.If you specify a color set object used by an onscreen view device as the target, this function posts a colorSet_access_restricted warning.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory colorSet_is_nil Warnings colorSet_access_restricted (debugging version) SEE ALSO
To create a new color set that is not a copy of an existing color set, use theGXNewColorSet
function, described on page 4-64.To compare two color set objects, use the
GXEqualColorSet
function, described in the next section.